package com.gooluke.mds.controller;

import com.gooluke.mds.domain.entity.TUserInfo;
import com.gooluke.mds.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author gooluke
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/list")
    public List<TUserInfo> list(String datasource) {
        return userService.selectList();
    }

    @RequestMapping("/insert")
    public int insertUser(@RequestBody TUserInfo userInfo) {
        return userService.insertUser(userInfo);
    }

    @RequestMapping("/insert2")
    public int insertUser2(@RequestBody TUserInfo userInfo) {
        return userService.insertUser2(userInfo);
    }

}
